# All amounts stored as mg.

class ProteinContent:      
    UnspecifiedAminoAcids = 0
    Histidine = 0
    Isoleucine = 0
    Leucine = 0
    Lysine = 0
    Methionine = 0
    Phenylalanine = 0
    Threonine = 0
    Tryptophan = 0
    Valine = 0
    Arginine = 0
    Cysteine = 0
    Glutamine = 0
    Glycine = 0
    Proline = 0
    Serine = 0
    Tyrosine = 0
    Asparagine = 0
    Alanine = 0
    Aspartate = 0
    Cysteine = 0
    Glutamate = 0
    Selenocysteine = 0
    
    def getAmountOfNonSpecifiedAminoAcids(self):
        return self.UnspecifiedAminoAcids
        
    def getAmountOfEssentialAminoAcids(self):
        return  self.Histidine + \
                self.Isoleucine + \
                self.Leucine + \
                self.Lysine + \
                self.Methionine + \
                self.Phenylalanine + \
                self.Threonine + \
                self.Tryptophan + \
                self.Valine
                
    def getAmountOfSemiEssentialAminoAcids(self):
        return  self.Arginine + \
                self.Cysteine + \
                self.Glutamine + \
                self.Glycine + \
                self.Proline + \
                self.Serine + \
                self.Tyrosine + \
                self.Asparagine
                
    def getAmountofNonEssentialAminoAcids(self):
        return  self.Alanine + \
                self.Aspartate + \
                self.Cysteine + \
                self.Glutamate + \
                self.Selenocysteine
                
    def getTotalAmountOfAminoAcids(self):
        return  self.getAmountOfNonSpecifiedAminoAcids() + \
                self.getAmountOfEssentialAminoAcids() + \
                self.getAmountOfSemiEssentialAminoAcids() + \
                self.getAmountofNonEssentialAminoAcids()
                
def makeJsonable(obj):
    assert isinstance(obj, ProteinContent)
    return {'UnspecifiedAminoAcids' : obj.UnspecifiedAminoAcids,
            'Histidine' : obj.Histidine,
            'Isoleucine' : obj.Isoleucine,
            'Leucine' : obj.Leucine,
            'Lysine' : obj.Lysine,
            'Methionine' : obj.Methionine,
            'Phenylalanine' : obj.Phenylalanine,
            'Tryptophan' : obj.Tryptophan,
            'Valine' : obj.Valine,
            'Arginine' : obj.Arginine,
            'Cysteine' : obj.Cysteine,
            'Glutamine' : obj.Glutamine,
            'Glycine' : obj.Glycine,
            'Proline' : obj.Proline,
            'Serine' : obj.Serine,
            'Tyrosine' : obj.Tyrosine,
            'Asparagine' : obj.Asparagine,
            'Alanine' : obj.Alanine,
            'Aspartate' : obj.Aspartate,
            'Cysteine' : obj.Cysteine,
            'Glutamate' : obj.Glutamate,
            'Selenocysteine' : obj.Selenocysteine}


